package com.blb.zycommunity.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.blb.zycommunity.entity.ZyVisitor;
import com.blb.zycommunity.mapper.ZyVisitorMapper;
import com.blb.zycommunity.service.IZyVisitorService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 * 访客邀请  服务实现类
 * </p>
 *
 * @author chenheng
 * @since 2023-11-20
 */
@Service
public class ZyVisitorServiceImpl extends ServiceImpl<ZyVisitorMapper, ZyVisitor> implements IZyVisitorService {

    @Autowired
    private ZyVisitorMapper zyVisitorMapper;

    @Override
    public IPage<ZyVisitor> findVisitorPage(Long current, Long size, String communityId, String visitorName, String visitorPhoneNumber, LocalDate visitorDate) {
        return zyVisitorMapper.selectVisitorPage(new Page<>(current,size),communityId,visitorName,visitorPhoneNumber,visitorDate);
    }

    @Override
    public List<ZyVisitor> findVisitors(String communityId, String createById) {
        return zyVisitorMapper.selectVisitors(communityId,createById);
    }
}
